package com.threaddemo7;

public class UnReentryCount {
    UnReentryLock lock = new UnReentryLock();
    public void print() throws InterruptedException {
        lock.lock();
        doAdd();
        lock.unlock();
    }
    public void doAdd() throws InterruptedException {
        lock.lock();
        //do something
        System.out.println("doAdd...");
        lock.unlock();
    }

    public static void main(String[] args) throws InterruptedException {
        new UnReentryCount().print();
    }

}
